package com.hl.wuyeguanliIDEA.web;

import com.hl.wuyeguanliIDEA.pojo.LeaveApplication;
import com.hl.wuyeguanliIDEA.service.LeaveApplicationService;
import com.hl.wuyeguanliIDEA.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/leave")
public class LeaveApplicationController {
    @Autowired
    private LeaveApplicationService leaveApplicationService;
    @RequestMapping("insert")
    public R insert(LeaveApplication record){
        int num=leaveApplicationService.insert(record);
        return R.success(record);
    }
    @RequestMapping("/select")
    public List<LeaveApplication> select(LeaveApplication l) {
        return leaveApplicationService.select1(l);
    }
    @RequestMapping("/select2")
    public List<LeaveApplication> select2(LeaveApplication l) {
        return leaveApplicationService.select2(l);
    }
    @RequestMapping("/update1")
    public int update1(LeaveApplication l) {
        return leaveApplicationService.update1(l);
    }
    @RequestMapping("/update2")
    public int update2(LeaveApplication l) {
        return leaveApplicationService.update2(l);
    }
}
